package cn.itcast.bos.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import cn.itcast.bos.domain.base.Courier;

public interface CourierRepository extends JpaRepository<Courier, Integer>,JpaSpecificationExecutor<Courier> {

	//定义JPQl
	@Query("update Courier set deltag ='1' where id =?1")
	@Modifying
//	@Query(value = "update Courier set deltag='1' where id = ?1")
//	@Modifying
	public void updateDelTag(Integer id);

	@Query(value="from Courier c inner join fetch c.fixedAreas f where f.id=?")
	public List<Courier> findAssociationCourier(String fixedAreaId);

}
